﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestPlatform.Core;
using TestPlatform.Performer.MongoDB.Entities;
using MongoDB.Driver.Builders;

namespace TestPlatform.Performer.MongoDB
{
    public class MongoDBDeletePerformer : BaseDeletePerformer
    {
        public override string UnderlyinEngine { get { return "MongoDB"; } }

        public MongoDBDeletePerformer()
            : base(new MongoDBHelper())
        {

        }

        protected override void RemoveEntity(Guid id)
        {
            var collection = MongoDBHelper.GetDatabase().GetCollection<User>("Users");

            collection.Remove(Query.EQ("_id", id));
        }
    }
}
